]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Calendar: make current date label clickable
authorVit Stanislav <slaweet@seznam.cz>
Mon, 16 Jan 2012 12:01:18 +0000 (13:01 +0100)
committerVolker Sobek <reklov@live.com>
Wed, 5 Mar 2014 15:40:56 +0000 (16:40 +0100)
Once you start navigating between months, you can't return to the
current day.  However, the current day is always displayed above the
calendar grid.  Fix this by making the current date clickable; when
clicked, the calendar grid jumps back to that day.

https://bugzilla.gnome.org/show_bug.cgi?id=641366

data/theme/gnome-shell.css
js/ui/dateMenu.js

index 613ae0ca3935ea673af427312e59a6eec9224fc3..ac33643ebd68bd589f831eade9f23199dacc5b28 100644 (file)
@@ -1304,12 +1304,18 @@ StScrollBar StButton#vhandle:active {
     font-weight: bold;
     text-align: center;
     color: #eeeeec;
+    border-radius: 4px;
 }
 
+.datemenu-date-label:hover,
 .datemenu-date-label:focus {
     background-color: #999999;
 }
 
+.datemenu-date-label:active {
+    background-color: #aaaaaa;
+}
+
 .calendar-day-base {
     font-size: 9pt;
     text-align: center;
index ee36019dc3651fe707eb585e26ea5689fc4da9c2..e869607069be2dec30372d96235a7c0801815c69 100644 (file)
@@ -63,9 +63,14 @@ const DateMenuButton = new Lang.Class({
         hbox.add(vbox);
 
         // Date
-        this._date = new St.Label({ style_class: 'datemenu-date-label',
-                                    can_focus: true });
-        vbox.add(this._date);
+        this._date = new St.Button({ style_class: 'datemenu-date-label',
+                                     can_focus: true,
+                                   });
+        this._date.connect('clicked',
+                           Lang.bind(this, function() {
+                               this._calendar.setDate(new Date(), false);
+                           }));
+        vbox.add(this._date, { x_fill: false  });
 
         this._eventList = new Calendar.EventsList();
         this._calendar = new Calendar.Calendar();
@@ -186,7 +191,7 @@ const DateMenuButton = new Lang.Class({
          */
         let dateFormat = _("%A %B %e, %Y");
         let displayDate = new Date();
-        this._date.set_text(displayDate.toLocaleFormat(dateFormat));
+        this._date.set_label(displayDate.toLocaleFormat(dateFormat));
     },
 
     _getCalendarApp: function() {